<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="lib/daterangepicker/daterangepicker.css" /> 

<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>推广申请列表</title>
<style type="text/css">
    .td-indexshow span{cursor: pointer;}
    .wenhao{
        width: 20px; height: 20px; border-radius: 100%; border:#d8d8d8 1px solid; font-size: 12px; display: inline-block;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); color: #999; margin-left: 5px;
    }
    .remark{padding: 3px 5px; border-radius: 5px; border:#d8d8d8 1px solid; font-size: 12px; display: inline-block;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); color: #999; margin-left: 5px;}
    .t-red{color: #c62b26;}
    .t-hui{color:#999 }

    .reasonblank{
        background-color: #f9f9f9; 
        border:#ddd 1px solid; 
        border-bottom: 0px; 
        height: 500px; 
        border-radius: 3px;
        position: fixed;
        width: auto;
        top: 20%;
        right: 100px; 
        display: none;

        padding-bottom: 50px;
    }
    .reasonblank i{position: absolute; right: -10px; top: -22px; font-size: 30px;}
    .reason{height: 500px;      overflow-y: scroll; display: block;}
    
    .reason .input{position: absolute; bottom: 5px; width: 100%;}
    .reason .input span{display: inline-block;}
    .reason .input span.right{width: 10%;}
    .reason .input span.left{width: 85%;}
    .reason li{border-bottom:#ddd 1px solid; list-style: none; padding: 5px 10px; position: relative; cursor: pointer;}
    .reason li:hover{background-color: #fff;}

    .pagefun-shenhe:hover{background-color: #000;}
    
</style>
</head>
<body class="pos-r">

<!-- <div class="ui-loading-block" id="loading">
    <div class="ui-loading-cnt">
        <i class="ui-loading-bright"></i>
        <p>正在加载中...</p>
    </div>
</div> -->

<div >
    <nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i> <a _href="welcome.html" class="fun-toindex" href="javascript:;">首页</a> 
        <span class="c-gray en">&gt;</span><a href="product-list.html"> 推广管理</a> 
        <span class="c-gray en">&gt;</span> 推广申请列表 
        <a class="btn btn-success radius r mr-20 reload" style="line-height:1.6em;margin-top:3px" href="javascript:;" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
        <!-- <span class="r" style="margin-top: -2px; box-sizing: border-box;">
            
            <select name="cid1" id="cid1" class="select" style="width: auto; height: 31px; vertical-align: middle;">
                <option value="" selected="">全部分类</option>
            </select>

            <select name="cid2" id="cid2" class="select" style="width: auto; height: 31px; vertical-align: middle;">
                <option value="" selected="">全部分类</option>
            </select>

            <select name="state" id="state" class="select" style="width: auto; height: 31px; vertical-align: middle;">
                <option value="" selected="">审核状态</option>
                <option value="2">不通过</option>
                <option value="1">通过</option>
                <option value="0">等待审核</option>
                <option value="3">已发货</option>
                <option value="5">已确认收货</option>
                <option value="70">已超期</option>
            </select>

            <div style="display:inline-block; width:380px; position:relative;">
                日期范围：
                <input name="time" type="text" id="date-range1" class="input-text datainp" style="width:300px">
                <i class="Hui-iconfont i-close" id="inputclear">&#xe706;</i>
            </div>
    
            <span style="position:relative">
                <input type="text" name="keywords" id="search-input" placeholder="回执、快递单号/货名/手机号/备注/用户名/ID" style="width:250px" class="input-text">
                <i class="Hui-iconfont i-close" id="inputclear">&#xe706;</i>
            </span>

            <button name="" id="search" class="btn btn-success"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
            <button id='export' class="btn btn-success">导出EXCEL</button>
        </span> -->
    </nav>
    
 
        
    <div class="pd-10">
        <table class="table table-border table-bordered table-bg table-hover table-sort">
            <thead>
                <tr class="text-c sort0">
                    <th width="40" class="valueid"><input name="" type="checkbox" value=""></th>
                    <th width="40" class="fun-sort2" data-name="id" data-flag="0">ID</th>
                    <th width="100">申请者</th>
                    <th width="80">联系电话</th>
                    
                    <th width="70" class="fun-sort2" data-name="apply_time" data-flag="0">申请时间</th>
                    <th width="70" class="fun-sort2" data-name="approval_time" data-flag="0">审核时间</th>
  
                    <th width="120">当前状态</th>
                    
                    <!-- <th width="80">是否上架</th> -->
                    
                    <!-- <th width="60">操作</th> -->
                </tr>
            </thead>
            <tbody id="content_sp">
              
            </tbody>
        </table>    
    </div>

    <div class="cl pd-5 bg-1 bk-gray mt-20 mb-20" id="operation"> 
<!--         <a href="javascript:;" class="btn btn-warning l mr-10 mt-5 radius fun-all" data-type="stop"><i class="Hui-iconfont">&#xe6de;</i> 批量关闭</a> 
        <a href="javascript:;" class="btn btn-success l mr-10 mt-5 radius fun-all" data-type="start"><i class="Hui-iconfont">&#xe603;</i> 批量开启</a> 
 -->        <a href="javascript:;" class="btn btn-danger l mr-10 mt-5 radius fun-all" data-type="del"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> 
        <span class="r pt-5"  style="line-height: 35px;" id="page"></span>
        <span class="r mr-10"  style="line-height: 40px;" id="dataall"></span>  
    </div>
        
</div>
</div>

<!-- 货物列表模版 -->
<script id="test" type="text/html">
    <% for (x in list) { %>
    <tr class="text-c va-m sort1">
        <td class="valueid"><input name="" type="checkbox" value="<%=list[x].id%>"></td>
        <td><%=list[x].id%></td>
        
        <td><%=list[x].name%> (<%=list[x].uid%>)</td>
        
        <td><%=list[x].user_mobile%></td>

        <td><%=list[x].apply_time%></td>
        
        <td><%=list[x].approval_time%></td>


        <td class="td-indexshow">
            
            <%if(list[x].is_approved==1){ %>
                <span style="color:#c62b26; cursor: pointer;">已审核</span>
            <%}else if(list[x].is_approved==2){%>
                <span>审核不通过</span>
            <%}else{%>
                <span class="label radius pagefun-shenhe" data-index="<%=x%>" data-flag="1" style="cursor: pointer;">通过</span>
                <span class="label radius pagefun-shenhe" data-index="<%=x%>" data-flag="2" style="cursor: pointer;" title="<%=list[x].reason%>">不通过</span>
            
                
               

                
            <%}%>
        </td>
        
        <!-- <td class="td-status">
            <%if(list[x].apply_state=='4'){%> 
                <input type="checkbox" class="switch fun-start-stop" style="outline: none;" <%if(list[x].goods_show==1){ %>checked<% }%> />
            <%}else{%>
                
            <%}%>
        </td> -->
        
        <!-- <td class="td-manage f-18">     
            <a style="text-decoration:none" class="ml-5 fun-del" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
            <a style="text-decoration:none" onClick="_open('货物编辑','product-add.html?editid=<%=list[x].id%>','90%','80%',true)" class="ml-5 edit" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> 
        </td> -->
    </tr>
    <%}%>  
</script> 
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript" src="js/template-native.js"></script> 
<script type="text/javascript" src="js/s.js"></script> 


<script type="text/javascript" src="lib/laypage/laypage.js"></script> 
<script type="text/javascript" src="lib/daterangepicker/moment.min.js"></script> 
<script type="text/javascript" src="lib/daterangepicker/jquery.daterangepicker.js"></script>
<script src="/Manage/js/lazyload.min.js"></script>
<script type="text/javascript">
var API=API_TGAPPLY;
var kk=API_TGAPPLY;//用于搜索和上下翻页
var uid=getUrlParam('uid');//用户详情查询使用
var orderby='';
var search='';

if(uid!==null && uid!==undefined){
    API=API+'?uid='+uid;
    // $("nav").hide();
    // $("#operation").hide();
}
loaddata(API,1,true);
// $('#date-range1').dateRangePicker({
//     startOfWeek: 'monday',
//     separator : ' 至 ',
//     format: 'YYYY-MM-DD HH:mm',
//     autoClose: true,
//     time: {
//         enabled: true
//     },
//     defaultTime: moment().startOf('day').toDate(),
//     defaultEndTime: moment().endOf('day').toDate()
// });


$(document).ready(function(){ 




    
        

    // 货物操作、审核/确认收货、拒收
    $(document).on('click','span.pagefun-shenhe',function(){
        var id=$(this).parent().parent().find("td.valueid:first-child input").val();
        var that=$(this);       
        var flag=that.data("flag");
        var tips="";
        flag==1? tips="审核通过" : tips="审核不通过";
        $.post(API_TGAPPLYSH,{id:id,is_approved:flag},function(data){
            if(!checkStatus(data)) return;
            if(data.status==1){
                that.parent().html(tips);   
                layer.msg(data.info, {icon:1,time:1000});  
            }else{
                layer.msg(data.info, {icon:2,time:1000});
            }
        },'json');  
        
        
    })

    





    // $("#search").click(function(){
    //     kk=API+"?";
    //     var content=encodeURI(document.querySelector('input[name=keywords]').value);
    //     var param=[
    //         'k='+encodeURI(document.querySelector('input[name=keywords]').value),
    //         'cid1='+document.querySelector('select[name=cid1]').value,
    //         'cid2='+document.querySelector('select[name=cid2]').value,
    //         't='+document.querySelector('select[name=state]').value,
    //         'time='+document.querySelector('input[name=time]').value,

    //     ];
    //     kk=kk+param.join('&');
    //     loaddata(kk,1,true);    
    // })

    // $(document).on('click','#export',function(){
    //     var param=[
    //         'k='+encodeURI(document.querySelector('input[name=keywords]').value),
    //         'cid1='+document.querySelector('select[name=cid1]').value,
    //         'cid2='+document.querySelector('select[name=cid2]').value,
    //         't='+document.querySelector('select[name=state]').value,
    //         'time='+document.querySelector('input[name=time]').value,
    //     ];
    //     param=param.join('&');
    //     window.open(API_EXPORT_APPLY+'?'+param);
    //     console.log(API_EXPORT_APPLY+'?'+param)
    // })

    // $(document).on('click','td.searchstore',function(){
    //     var storeid=$(this).data("storeid");
    //     kk=API+"?sid="+storeid;
    //     loaddata(kk,1,true);    
    // })


    

   
    
    
})





        



</script>
</body>
</html>